<?xml version="1.0"?>
<recipe>
	<#if isActivity>
	
		<#-- 选择Activiy则生成Activity-->
		<instantiate from="root/src/app_package/SimpleActivity.${ktOrJavaExt}.ftl"
					   to="${escapeXmlAttribute(srcOut)}/module/${dirName?replace('.', '/')}/${className}Activity.${ktOrJavaExt}" />
					   
		<#-- 生成后打开Activiy-->
		<open file="${escapeXmlAttribute(srcOut)}/module/${dirName?replace('.', '/')}/${className}Activity.${ktOrJavaExt}" />
		
		<#-- 在Manifest文件中添加Activity-->
		<merge from="root/AndroidManifest.xml.ftl"
           to="${escapeXmlAttribute(manifestOut)}/AndroidManifest.xml" />
   
	<#else>
	
		<#-- 不选择Activiy则生成Fragemnt-->
		<instantiate from="root/src/app_package/SimpleFragment.${ktOrJavaExt}.ftl"
					   to="${escapeXmlAttribute(srcOut)}/module/${dirName?replace('.', '/')}/${className}Fragment.${ktOrJavaExt}" />
					   
		<#-- 生成后打开Fragemnt-->
		<open file="${escapeXmlAttribute(srcOut)}/module/${dirName?replace('.', '/')}/${className}Fragment.${ktOrJavaExt}" />
	</#if>

	
	<!-- 生成VM-->
	<instantiate from="root/src/app_package/SimpleVM.${ktOrJavaExt}.ftl"
                   to="${escapeXmlAttribute(srcOut)}/vm/${className}VM.${ktOrJavaExt}" />
				   
	<!-- 打开VM-->
    <open file="${escapeXmlAttribute(srcOut)}/vm/${className}VM.${ktOrJavaExt}" />
	
	<!-- 生成Model-->
	<instantiate from="root/src/app_package/SimpleModel.${ktOrJavaExt}.ftl"
                   to="${escapeXmlAttribute(srcOut)}/model/${className}Model.${ktOrJavaExt}" />
				   
	<!-- 打开Model-->
    <open file="${escapeXmlAttribute(srcOut)}/model/${className}Model.${ktOrJavaExt}" />
	
	<!-- 生成布局文件-->
	<#if generateLayout>
		<#if isActivity>
		<instantiate from="root/res/layout/simple.xml.ftl"
                   to="${escapeXmlAttribute(resOut)}/layout/activity_${className?replace('([a-z])([A-Z]+)','$1_$2','r')?lower_case}.xml" />
		<open file="${escapeXmlAttribute(resOut)}/layout/activity_${className?replace('([a-z])([A-Z]+)','$1_$2','r')?lower_case}.xml" />
			
		<#else>
		<instantiate from="root/res/layout/simple.xml.ftl"
                   to="${escapeXmlAttribute(resOut)}/layout/fragment_${className?replace('([a-z])([A-Z]+)','$1_$2','r')?lower_case}.xml" />
			<open file="${escapeXmlAttribute(resOut)}/layout/fragment_${className?replace('([a-z])([A-Z]+)','$1_$2','r')?lower_case}.xml" />
		</#if>
	</#if>
</recipe>
